package com.service.hibernate.pojos;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@SuppressWarnings("serial")
@Entity
@Table(name = "vehicles")
public class Vehicles implements Serializable{
	@Id
	@Column(name = "reg_no")
	private String vehRegNo;

	@Column(name = "type")
	private String vehType;

	@Column(name = "mileage")
	private String vehMileage;

	@Column(name = "customer_id")
	private String vehCustomerId;
	
	@OneToMany(fetch=FetchType.LAZY,mappedBy="vehicle")
	private List<Services> services=new ArrayList<Services>();
	
	public Vehicles(){
		
	}

	public Vehicles(String vehRegNo, String vehType, String vehMileage,
			String vehCustomerId) {
		super();
		this.vehRegNo = vehRegNo;
		this.vehType = vehType;
		this.vehMileage = vehMileage;
		this.vehCustomerId = vehCustomerId;
	}

	public Vehicles(String vehRegNo, String vehType, String vehMileage,
			String vehCustomerId, List<Services> vehServices) {
		this.vehRegNo = vehRegNo;
		this.vehType = vehType;
		this.vehMileage = vehMileage;
		this.vehCustomerId = vehCustomerId;
		this.services = vehServices;
	}

	public String getVehRegNo() {
		return vehRegNo;
	}

	public void setVehRegNo(String vehRegNo) {
		this.vehRegNo = vehRegNo;
	}

	public String getVehType() {
		return vehType;
	}

	public void setVehType(String vehType) {
		this.vehType = vehType;
	}

	public String getVehMileage() {
		return vehMileage;
	}

	public void setVehMileage(String vehMileage) {
		this.vehMileage = vehMileage;
	}

	public String getVehCustomerId() {
		return vehCustomerId;
	}

	public void setVehCustomerId(String vehCustomerId) {
		this.vehCustomerId = vehCustomerId;
	}

	
	public List<Services> getServices() {
		return services;
	}

	public void setVehServices(List<Services> services) {
		this.services = services;
	}

	
	
}
